package cn.xshi.log.service.impl;

import cn.xshi.log.model.LogLoadinfo;
import cn.xshi.common.base.BaseService;
import cn.xshi.common.util.ExceptionUtil;
import cn.xshi.log.dao.LogLoadinfoDao;
import cn.xshi.log.service.LogLoadinfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @Desc 页面加载信息 
* @Author 邓纯杰
* @CreateTime 2022-08-24 12:22:05
*/
@Service
public class LogLoadinfoServiceImpl extends BaseService implements LogLoadinfoService{

	@Resource
	private LogLoadinfoDao logLoadinfoDao;

	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<LogLoadinfo> getLogLoadinfoListByCondition(Map<String,Object> condition){
		try{
			return logLoadinfoDao.getLogLoadinfoListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}

	/**
	* 查询对象
	* @param id 
	* @return
	*/
	public LogLoadinfo getLogLoadinfoById(String id){
		try{
			LogLoadinfo logLoadinfo = logLoadinfoDao.getLogLoadinfoById(id);
			return logLoadinfo;
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}

	/**
	* 添加
	* @param logLoadinfo 
	* @return
	*/
	public int addLogLoadinfo(LogLoadinfo logLoadinfo){
		int i = 0;
		try {
			i = logLoadinfoDao.addLogLoadinfo(logLoadinfo);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 修改
	* @param logLoadinfo 
	* @return
	*/
	public int updateLogLoadinfo(LogLoadinfo logLoadinfo){
		int i = 0;
		try {
			i = logLoadinfoDao.updateLogLoadinfo(logLoadinfo);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 修改（根据动态条件）
	* @param logLoadinfo 
	* @return
	*/
	public int updateLogLoadinfoBySelective(LogLoadinfo logLoadinfo){
		int i = 0;
		try {
			i = logLoadinfoDao.updateLogLoadinfoBySelective(logLoadinfo);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delLogLoadinfo(Map<String,Object> condition){
		int i = 0;
		try {
			i = logLoadinfoDao.delLogLoadinfo(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
